import { defineAsyncComponent } from 'vue';

const views = {
    // red: defineAsyncComponent(() => import('./views/EmptyView.vue')),
    // form: defineAsyncComponent(() => import('./views/FormView.vue')),
    // table: defineAsyncComponent(() => import('./views/CurdView.vue')),
    menu: defineAsyncComponent(() => import('menu-ui-aoe')),
    // schema: defineAsyncComponent(() => import('./schema/AoeModule.vue')),
    // main: defineAsyncComponent(() => import('./main/AoeMain.vue')),
    tree: defineAsyncComponent(() => import('./views/AoeTreeEditor.vue')),
    login: defineAsyncComponent(() => import('./pages/AoeLogin.vue')),
    main: defineAsyncComponent(() => import('./pages/AoeMain.vue')),
    // board: defineAsyncComponent(() => import('./views/BoardView.vue')),
    // gallery: defineAsyncComponent(() => import('./views/GalleryView.vue')),
    // play: defineAsyncComponent(() => import('@aoe/play')),
};

type ViewName = keyof typeof views;
export const getView = (name: string) => views[name as ViewName] ?? name;
